<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Founder extends CI_Controller {

 
	function __construct()
	{
		parent::__construct();
		
		// check if user logged in 
		if (!$this->ion_auth->logged_in())
	  	{
			redirect('auth/login');
	  	}		
		$this->load->model('founder/founder_model');
		
	}	
	
   function index()
   {
     $id=$this->session->userdata['user_id'];
	
		 	$meta['page_title'] = "welcome user";
			$data['recent_tasks'] = $this->founder_model->get_recent_tasks();
			$data['active_user'] = $this->founder_model->active_user();
			$data['inactive_user'] = $this->founder_model->inactive_user();
			$data['client']=$this->founder_model->client_data();
			$data['product']=$this->founder_model->product_data();
			$data['purchase']=$this->founder_model->purchase_data();
			$data['today_purchase']=$this->founder_model->today_purchase();
			$data['today_sale']=$this->founder_model->today_sale();
		    $data['sale']=$this->founder_model->sale_data();
			$data['username']=$this->founder_model->get_userdata($id);
			$data['income']=$this->founder_model->get_income();
			$meta['message'] = "Logged In Successfully";
			$meta['dashboard'] = "dashboard";   
		 	$this->load->view('common/header', $meta);
		  	$this->load->view('founder/dashboard',$data);
		  	$this->load->view('common/footer');
   }
}
	
	?>